var torrent = {};

torrent.showSolutions = function (rowItem){
	var torrent_vots =  Ti.UI.createView({
		height:80,
		width:135,
		left:5,
		top:30,
		backgroundColor:'white',
		borderRadius:12,
		borderWidth:1,
		borderColor:'#000'
	});
	
	var vot_down = Ti.UI.createImageView({
		image:'img/idea_down_grey.png',
		left:0,
		top:0,
		width:50,
		height:50
	});
	
	var vot_equal = Ti.UI.createImageView({
		image:'img/idea_equal_grey.png',
		left:40,
		top:0,
		width:50,
		height:50
	});
	
	var vot_up = Ti.UI.createImageView({
		image:'img/idea_up_grey.png',
		left:80,
		top:0,
		width:50,
		height:50
	});
	
	torrent_vots.add(vot_down);
	torrent_vots.add(vot_equal);
	torrent_vots.add(vot_up);
	
	torrentRowItem.add(torrent_vots);
};
/*
 * 
 torrent status codes 
 -1: vigents
 
 2: en desenvolupament
 3: finalitzades
 
 7: sala d'espera, idees no valides
 8: sala d'espera, candidatures valides
 */

/*
if(!user.isDefined()){
	var loginView = Ti.UI.createView({
		backgroundColor:'transparent'
	});
	var loginButton = Ti.UI.createButton({
		title:'Login',
		width:100,
		height:40,
		top:180
	});
	
	var loginTextField = Ti.UI.createTextField({
		autocapitalization:Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
		color:'#336699',
		hintText:"Usuario",
		height:40,
		top:60,
		//left:35,
		width:250,
		borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED
	});
	loginView.add(loginTextField);
	
	var passwordTextField = Ti.UI.createTextField({
		autocapitalization:Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
		color:'#336699',
		hintText:"Password",
		height:40,
		top:120,
		//left:35,
		width:250,
		borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED
	});
	loginView.add(passwordTextField);
	
	loginButton.addEventListener('click',function()
	{
		loginTextField.blur();
		passwordTextField.blur();
		loginView.hide();
	});
	loginView.add(loginButton);
	
	win.add(loginView);
	
}else{
	
	var webview = Ti.UI.createWebView({top:60});
	var button = Ti.UI.createButton({
		left:5,
		top:5,
		height:50,
		width:80,
		backgroundColor:'#3A3A3A',
		color:'#000',
		title:'CALL',
		font:{fontSize:20},
		fontWeight:'bold',
		style:Ti.UI.iPhone.SystemButtonStyle.BORDERED
	});
	var button2 = Ti.UI.createButton({
		left:90,
		top:5,
		height:50,
		width:80,
		backgroundColor:'#3A3A3A',
		color:'#000',
		title:'CALL2',
		font:{fontSize:20},
		fontWeight:'bold',
		style:Ti.UI.iPhone.SystemButtonStyle.BORDERED
	});
	var button3 = Ti.UI.createButton({
		left:175,
		top:5,
		height:50,
		width:80,
		backgroundColor:'#3A3A3A',
		color:'#000',
		title:'CALL3',
		font:{fontSize:20},
		fontWeight:'bold',
		style:Ti.UI.iPhone.SystemButtonStyle.BORDERED
	});
	button.addEventListener('click',function(){
		network.getTokenFromWeb('ignasi.artigas','aaaaaaaaa',webview);
	});
	button2.addEventListener('click',function(){
		network.getTokenFromWeb('ignasi.artigas','_ssssssss',webview);
	});
	button3.addEventListener('click',function(){
		network.checkSession(webview);
	});
	
	win.add(button);
	win.add(button2);
	win.add(button3);
	win.add(webview);

}
*/
/*
var invisiwindow = Ti.UI.createWindow(config.url_ideatorrent);
invisiwindow.visible = false;
invisiwindow.open();
invisiwindow.addEventListener(Ti.PAGE_LOADED, function() {
    invisiwindow.close();
    
});
*/